package com.lry.web.user.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.lry.web.user.entity.User;
import com.lry.web.user.mapper.UserMapper;
import com.lry.web.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    UserMapper userMapper;
    public User selectUser(User user) {
        QueryWrapper wrapper =new QueryWrapper();
        wrapper.eq("username",user.getUsername());
        wrapper.eq("password",user.getPassword());
        return userMapper.selectOne(wrapper);
    }

    public int updatePassword(User user,String password) {
        user.setPassword(password);
        return userMapper.updateById(user);
    }
}
